/**
 * 
 */
package slhs.tempo.scriptGenerator;

import javax.swing.JSlider;
import javax.swing.ToolTipManager;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

/**
 * SliderChangeListener.java
 * 
 * @author Swapnil Devikar
 * 
 */
public class SliderChangeListener implements ChangeListener {

    /*
     * (non-Javadoc)
     * 
     * @see javax.swing.event.ChangeListener#stateChanged(javax.swing.event.ChangeEvent)
     */
    @Override
    public void stateChanged(ChangeEvent event) {
	// shall be modified to keep the tool tip text visible
	ToolTipManager.sharedInstance().setInitialDelay(0);

	JSlider slider = (JSlider) event.getSource();
	slider.setToolTipText(Integer.toString(slider.getValue()));
    }

}
